$OpenBSD: patch-setup_build_py,v 1.4 2017/05/13 18:26:03 espie Exp $
Index: setup/build.py
--- setup/build.py.orig
+++ setup/build.py
@@ -36,13 +36,6 @@ class Extension(object):
         self.cflags = d['cflags'] = kwargs.get('cflags', [])
         self.ldflags = d['ldflags'] = kwargs.get('ldflags', [])
         self.optional = d['options'] = kwargs.get('optional', False)
-        of = kwargs.get('optimize_level', None)
-        if of is None:
-            of = '/Ox' if iswindows else '-O3'
-        else:
-            flag = '/O%d' if iswindows else '-O%d'
-            of = flag % of
-        self.cflags.insert(0, of)
         self.qt_private_headers = d['qt_private_headers'] = kwargs.get('qt_private', [])
 
 
@@ -156,6 +149,8 @@ def init_env():
         cflags.append('-pthread')
         ldflags.append('-shared')
         cflags.append('-I'+sysconfig.get_python_inc())
+        cflags.append('-I'+os.path.join(sysconfig.PREFIX, 'include'))
+        ldflags.append('-L'+os.path.join(sysconfig.PREFIX, 'lib'))
         ldflags.append('-lpython'+sysconfig.get_python_version())
 
     if ishaiku:
